package com.zwz.bean;

import java.io.Serializable;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

/**
 * 
 * @author 26943
 * @TableName news_info
 */
@Data
public class NewsInfo implements Serializable {
    /**
     * 新闻ID
     */
    @TableId(value = "news_id",type = IdType.AUTO)
    private Integer newsId;

    /**
     * 新闻类型
     */
    private String newsType;

    /**
     * 新闻标题
     */
    private String newsTitle;

    /**
     * 新闻内容
     */
    private String newsContents;

    /**
     * 新闻作者
     */
    private String newsAuthor;

    /**
     * 发布时间
     */
    private Date publishTime;

    /**
     * 最后修改时间
     */
    private Date lastEditTime;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        NewsInfo other = (NewsInfo) that;
        return (this.getNewsId() == null ? other.getNewsId() == null : this.getNewsId().equals(other.getNewsId()))
            && (this.getNewsType() == null ? other.getNewsType() == null : this.getNewsType().equals(other.getNewsType()))
            && (this.getNewsTitle() == null ? other.getNewsTitle() == null : this.getNewsTitle().equals(other.getNewsTitle()))
            && (this.getNewsContents() == null ? other.getNewsContents() == null : this.getNewsContents().equals(other.getNewsContents()))
            && (this.getNewsAuthor() == null ? other.getNewsAuthor() == null : this.getNewsAuthor().equals(other.getNewsAuthor()))
            && (this.getPublishTime() == null ? other.getPublishTime() == null : this.getPublishTime().equals(other.getPublishTime()))
            && (this.getLastEditTime() == null ? other.getLastEditTime() == null : this.getLastEditTime().equals(other.getLastEditTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getNewsId() == null) ? 0 : getNewsId().hashCode());
        result = prime * result + ((getNewsType() == null) ? 0 : getNewsType().hashCode());
        result = prime * result + ((getNewsTitle() == null) ? 0 : getNewsTitle().hashCode());
        result = prime * result + ((getNewsContents() == null) ? 0 : getNewsContents().hashCode());
        result = prime * result + ((getNewsAuthor() == null) ? 0 : getNewsAuthor().hashCode());
        result = prime * result + ((getPublishTime() == null) ? 0 : getPublishTime().hashCode());
        result = prime * result + ((getLastEditTime() == null) ? 0 : getLastEditTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", newsId=").append(newsId);
        sb.append(", newsType=").append(newsType);
        sb.append(", newsTitle=").append(newsTitle);
        sb.append(", newsContents=").append(newsContents);
        sb.append(", newsAuthor=").append(newsAuthor);
        sb.append(", publishTime=").append(publishTime);
        sb.append(", lastEditTime=").append(lastEditTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}